<?php 
	$cwr_registrant_home_value = Cwr_registrant_member_homepage_value::cast($cwr_registrant_home_value); 

	Includes::IncludeFile( Includes::$FORM );
?>
<div class="validation-errors" id="validationErrors" style="display:none;"></div>
<div class="walk-home-container">
	<div class="walk-home-content">
		
		<h3>I am sponsoring</h3>
		
		Sponsoree First Name: <?php echo($cwr_registrant_home_value->getFirstName()) ?><br />
		Sponsoree Last Name:  <?php echo($cwr_registrant_home_value->getLastName()) ?><br />
		
		<br />
		<br />
		
		<?php
			echo( form_open(base_url() . 'cmb/sponsor_walker/sponsor_amount_summary/' . $urlKey . '/', array('id' => 'sponsorAmountForm') ) );
		
				Form::OpenFormItem('Enter Sponsorship Amount*:', 260);
					echo( '$' . form_input(array('name'=>'sponsorshipAmount','id'=>'sponsorshipAmount','style'=>'width: 100px;')) );
				Form::CloseFormItem();
				
			echo( form_close() );
		?>
	
		<div>
			<a href="javascript: validate();"><img src="<?php echo( base_url() );?>assets/images/buttons/next_off.gif" border="0" onmouseover="this.src = '<?php echo( base_url() );?>assets/images/buttons/next_over.gif';" onmousedown="this.src = '<?php echo( base_url() );?>assets/images/buttons/next_on.gif';" onmouseup="this.src = '<?php echo( base_url() );?>assets/images/buttons/next_off.gif';" onmouseout="this.src = '<?php echo( base_url() );?>assets/images/buttons/next_off.gif';" /></a>
		</div>
	</div>
	<div class="clear"></div>
</div>


<script type="text/javascript">
	function validate()
	{
		new Ajax.Request(baseUrl + 'validation/sponsor_validation/validate_sponsor_amount/', 
		{
			method:'post',
			parameters: Form.serialize( $('sponsorAmountForm') ),
		  	onSuccess: function(response)
			{
				var result = response.responseText;
				
				if( result == 'VALIDATION_SUCCESS' )
				{
					$('sponsorAmountForm').submit();
				}
				else
				{
					$('validationErrors').innerHTML = result;
					$('validationErrors').show();
					//Effect.ScrollTo('validationErrors', { duration:'0.2', offset:-20 });
				}
			},
			onFailure: function(response){}
		});
	}
	
</script>